package com.itheima.test;

import java.text.ParseException;
import java.util.Calendar;
import java.util.GregorianCalendar;

public class Tset {
    public static void main(String[] args) throws ParseException {
        /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date date = new Date();
        Date dateB = sdf.parse(new Date().toString());
        if (date.after(dateB)&&date.before(dateB))*/
       // Calendar calendar = new GregorianCalendar();
//        calendar.set(Calendar.HOUR, 0);
//        calendar.set(Calendar.MINUTE, 0);
//        calendar.set(Calendar.SECOND, 0);
        //System.out.println(calendar.getTime());
        //long time1 = calendar.getTimeInMillis();
        //System.out.println(time1);
//        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//        System.out.println(sdf.format(new GregorianCalendar().getTime()));
      //  String format = new SimpleDateFormat("yyyy-MM-dd").format(new GregorianCalendar().getTime());
        //System.out.println(format);
        //System.out.println(calendar.getTime().toString());
        //calendar.add(calendar.DATE, 1);
        //System.out.println(calendar.getTime() .toString());
        //long time2 = calendar.getTimeInMillis();
        //System.out.println(calendar.getTime());
        //System.out.println(time2);
        //System.out.println(new Date().getTime());

        //long time = new Date().getTime();

   /*     Date date = new Date(1000 * 3600 * 24 * 7);
        System.out.println(date);
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(1000 * 3600 * 24 * 7);System.out.println(c.getTime());*/

        Calendar calendar = new GregorianCalendar();
        calendar.set(Calendar.HOUR, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.add(calendar.DATE,-1);
        System.out.println(calendar.getTime());
        calendar.add(calendar.DATE,-1);
        System.out.println(calendar.getTime());
    }
}
